/*
  File:    DiffusionSolver.h
  Purpose: Provides a fully nonlinear diffusional solver 
           for a single time iteration. In particular, it 
		  solves the problem 
		   
		  u_t = div( DiffusionConstant(u,x,y,i,j) . grad(u) ) + Sources(u,x,y,i,j)
		   
		  with boundary conditions on the left, right, bottom, 
		  and top, of type:
		    
		  'D': Dirichlet
		  'N': Neuman
		  'E': Extrapolation/continuity

           Assumed:
            Can evaluate DiffusionConstant, Source, and 
		   boundary conditions at any point (x,y) where 
		   appropriate. 
    
            DiffusionConstant and Source can be nonlinear 
		   in u. 
   
           Result: 
            The solution u(x,y,t) at t+dt.   
		   
  Contact: Paul Macklin
           pmacklin@math.uci.edu
		  http://math.uci.edu/~pmacklin
*/

Matrix NonlinearDiffusionIteration( 
   Matrix& X, Matrix& Y, 
   Matrix& PreviousTimeStep , double dt, 
   double (*LeftBC)(double),   char LeftBCtype,  
   double (*RightBC)(double),  char RightBCtype,     
   double (*BottomBC)(double), char BottomBCtype,   
   double (*TopBC)(double),    char TopBCtype,  
   double (*DiffusionConstant)(double,double,double,int,int), 
   double (*Source)(double,double,double,int,int),
   int MaxIterations, double Tolerance );
Matrix NonlinearConvectionIteration( 
								   Matrix& X, Matrix& Y, 
								   Matrix& PreviousTimeStep ,Matrix& AnotherSource , double dt, 
								   double (*LeftBC)(double),   char LeftBCtype,  
								   double (*RightBC)(double),  char RightBCtype,     
								   double (*BottomBC)(double), char BottomBCtype,   
								   double (*TopBC)(double),    char TopBCtype,  
								   double (*DiffusionConstant)(double,double,double,int,int), 
								   double (*Source)(double,int,int),
								   int MaxIterations, double Tolerance );

/*
Matrix NonlinearDiffusionSteadyState( 
   Matrix& X, Matrix& Y, 
   Matrix& InitialGuess ,
   double (*LeftBC)(double),   char LeftBCtype,  
   double (*RightBC)(double),  char RightBCtype,     
   double (*BottomBC)(double), char BottomBCtype,   
   double (*TopBC)(double),    char TopBCtype,  
   double (*DiffusionConstant)(double,double,double,int,int), 
   double (*SourceTimesU)(double,double,double,int,int),
   double (*SourceRemainder)(double,double,double,int,int),
   int MaxIterations, double Tolerance );

Matrix NonlinearDiffusionSteadyStateNonAdaptive( 
   Matrix& X, Matrix& Y, 
   Matrix& InitialGuess ,
   double (*LeftBC)(double),   char LeftBCtype,  
   double (*RightBC)(double),  char RightBCtype,     
   double (*BottomBC)(double), char BottomBCtype,   
   double (*TopBC)(double),    char TopBCtype,  
   double (*DiffusionConstant)(double,double,double,int,int), 
   double (*SourceTimesU)(double,double,double,int,int),
   double (*SourceRemainder)(double,double,double,int,int),
   int MaxIterations, double Tolerance );
*/   
